from django import forms
from django.shortcuts import render_to_response
from django.template import RequestContext
from gestion.ventas.models import Venta
class Query(forms.Form):
	factura = forms.CharField(max_length = 20)
	
def look(request):
	
	if request.method == 'POST':
		factura = request.POST['factura']
		fact =  Query()
		res = Venta.objects.all().filter(factura = factura)
		return render_to_response('admin/query.html',{'fact':fact,'res':res})							
	else:
		fact =  Query()
		return render_to_response('admin/query.html',{'fact':fact})